class Solution(object):
    def merge(self, nums1, m, nums2, n):
        """
        :type nums1: List[int]
        :type m: int
        :type nums2: List[int]
        :type n: int
        :rtype: None Do not return anything, modify nums1 in-place instead.
        """

        i = 0
        j = 0
        nums1_index = 0
        while nums1_index < m and j < n:
            if nums1[i] <= nums2[j]:
                i += 1
                nums1_index += 1
            else:
                nums1[i+1:] = nums1[i:-1]
                nums1[i] = nums2[j]
                i += 1
                j += 1
        if nums1_index == m:
            nums1[i:] = nums2[j:]